package iscte.ai.kcgtd;

public class FreeBlocks extends CalendarBlocks{

	private OccupiedBlocks previousBlock;
	
	public FreeBlocks(KCGTDTime startHour, KCGTDTime endHour, OccupiedBlocks previousBlock) {
		super(startHour, endHour);
		this.previousBlock = previousBlock;
	}

	public OccupiedBlocks getPreviousBlock() {
		return previousBlock;
	}
	
	public void setPreviousBlock(OccupiedBlocks previousBlock) {
		this.previousBlock = previousBlock;
	}
	
	public String getPreviousBlockLocation() {
		return previousBlock.getBlockEventLocation();
	}

	@Override
	public int compareTo(CalendarBlocks another) {
		if(getStartTime().isAfter(another.getStartTime()))
			return 1;
		else if(getStartTime().isBefore(another.getStartTime()))
			return -1;
		else
			return 0;
	}
	
}
